export default {
  name: 'Render',
  methods: {
    handlerClick (e) {
      // console.log('click', e)
    }
  },
  props: {
    level: {
      type: Number,
      default: 1,
    }
  },
  render: function(h) {
    let lis = []
    for (let i = 0; i < this.level; i++) {
      lis.push(h('li', i + ' _ index'))
    }
    return h(
      'ul',
      {
        class: {
          foo: true,
          bar: false,
        },
        style: {
          background: 'pink',
        },
        attrs: {
          id: 'render-ui',
          'data-id': 'SIDJ@!DSAL',
        },
        props: {
          myProp: 'bar',
        },
        domProps: {
          alt: 'alt 提示',
        },
        on: {
          click: this.handlerClick
        },
        key: 'myKey',
        ref: 'render-dom',
      },
      lis
    )
  },
}